<template>
	<div>
		<div class="pl-6 pr-6 pt-6">
			<el-card class="!border-none p-4" shadow="never">
				<div class="font-bold main-color text-2xl mb-5">
					咨询信息
				</div>
				<el-form class="ls-form el-set-form" :model="formData" inline>
					<el-form-item label="联系工程师">
						<el-select class="w-[220px]" v-model="formData.type" placeholder="请选择">
							<el-option v-for="(item, index) in visitType" :key="index" :label="item.label"
								:value="item.value" />
						</el-select>
					</el-form-item>
					<el-form-item label="咨询类型">
						<el-radio-group v-model="radio1" class="ml-4"
						>
						      <el-radio label="1">询单价</el-radio>
						      <el-radio label="2">咨询单</el-radio>
						</el-radio-group>
					</el-form-item>
				</el-form>
			</el-card>
			<el-card class="!border-none mt-[30px] p-4" shadow="never">
			    <div class="flex justify-between">
					<div class="font-bold main-color text-2xl mb-5">
						产品信息
					</div>
			        <el-button type="primary" >
						<router-link
						    :to="{
						        path: getRoutePath(radio1== 1 ? 'enquiry.enquiry/goods' : 'enquiry.enquiry/message')
						    }"
						>
						   添加产品
						</router-link>
			        </el-button>
				</div>	
				<el-table class="mt-[20px]" size="large" :data="pager.lists" v-loading="pager.loading"
				:header-cell-style="{'background':'#0054A6','color':'#FFB400','line-height':'52px','padding':'14px 0'}"
				:cell-style="{'color':'#0054A6','padding':'20px 0'}"
				>
					<el-table-column label="产品图片" prop="scene_name" align="center" width="150">
						<el-avatar shape="square" :size="50" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
					</el-table-column>
					<el-table-column label="产品名称" prop="type_desc" align="center" />
					<el-table-column label="产品型号" prop="scene_name" align="center" />
					<el-table-column label="产品价格" prop="type_desc" align="center" />
					<el-table-column label="需求数量" prop="scene_name" align="center">
						<el-input class="w-[180px]" placeholder="请输入" clearable />
					</el-table-column>
					<el-table-column label="操作" fixed="right" align="center" >
						<template #default="{ row }">
							<el-button
							type="primary" 
							link
							>
								<span class="main-color1">删除</span>
							</el-button>
						</template>
					</el-table-column>
				</el-table>
			</el-card>
			<div class="mt-[40px]">
				<el-button class="main-color1 w-[76px]" >取消</el-button>
				<el-button class="w-[76px] bg-[#0054A6]" type="primary" >保存</el-button>
			</div>
		</div>	
	</div>
</template>

<script lang="ts" setup>
	import { computed, onMounted, reactive, ref, shallowRef } from 'vue'
	import { getRoutePath } from '@/router'
	import { noticeLists } from '@/api/message'
	import { usePaging } from '@/hooks/usePaging'
	
	const formData = reactive({
		admin_name: '',
		url: '',
		ip: '',
		type: '',
		start_time: '',
		end_time: ''
	})
	const visitType = ref<Array<any>>([
		{
			label: '晓明',
			value: '1'
		},
		{
			label: '小李',
			value: '2'
		},
	])
	const radio1 = ref('1')
	// 列表数据
	
	const { pager, getLists } = usePaging({
	    fetchFun: noticeLists,
	})
	const handleDelete = async (id: number) => {
	    await feedback.confirm('确定要删除？')
	    // await menuDelete({ id })
	    getLists()
	}
	onActivated(() => {
	    getLists()
	})
	
	getLists()
</script>

<style lang="scss" scoped>
	.el-set-form:deep() .el-form-item__label{
		color: var(--el-text-color-main);
		height: 36px;
		line-height: 36px;
	}
	.el-set-form:deep() .el-input__inner{
		height: 36px;
	}
	.el-set-form:deep() .el-input__inner::placeholder {
		color: var(--el-text-color-main);
	}
</style>